/**
 * 
 */
package org.cuatrovientos.caesar;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

/**
 * @author daniel_ancin
 *
 */
public class caesar_cypherTest {
	
	private caesar_cypher caesarCipher;
	

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
		caesarCipher =new caesar_cypher(3);
		
	}

	/**
	 * Test method for {@link org.cuatrovientos.caesar.caesar_cypher#caesar_cypher(int)}.
	 */
	@Test
	public void testCaesar_cypher() {
		int target = caesarCipher.getShift();
		int expected = 3;
		assertEquals("Test Constructor", target,expected);
	}

	/**
	 * Test method for {@link org.cuatrovientos.caesar.caesar_cypher#encrypt(java.lang.String)}.
	 */
	@Test
	public void testEncrpt() {
		String target= caesarCipher.encrypt("AVECAESAR");
		String expected = "dyhfdhvdu";
		assertEquals("Test encryption", target,expected);
	}

	/**
	 * Test method for {@link org.cuatrovientos.caesar.caesar_cypher#decrpt(java.lang.String)}.
	 */
	@Test
	public void testDecrpt() {
		String target= caesarCipher.decrpt("DYHFDHVDU");
		String expected = "avecaesar";
		assertEquals("Test Decrpt", target,expected);
		
	}

}
